<?php 
$categories = $mvc->getObject('category');
$subcategories = $mvc->getObject('subcategory');
?>
<form action="/manage-category.html" method="post">
	<ul class="viewIList">
		<li class="itemNewC"><a href="/new-category.html" class="linkLight" title="_i18n{New Category}">_i18n{New Category}</a></li>
		<li class="itemNewSC"><a href="/new-subcategory.html" class="linkLight" title="_i18n{New SubCategory}">_i18n{New SubCategory}</a></li>
		<li class="itemDelete"><button name="delCategory" onclick="return confirm('_i18n{You sure you want to delete?}');" >_i18n{Delete}</button></li>
	</ul>
	<h2>_i18n{Category}</h2>
	<div class="unitABlock">
		<table cellpadding="0" cellspacing="0" class="viewList">
			<thead>
				<tr>
					<th class="itemChk"><input type="hidden" name="itemSelectCategory" /></th>
					<th>_i18n{ID}</th>					
					<th class="itemLast">_i18n{Category}</th>
				</tr>
			</thead>
			<tbody>
			<?php if (count($categories)>0 && $categories!=NULL){
			foreach($categories as $key => $category){ ?>
				<tr>
					<td><input type="checkbox" class="inpChk" name="Category" value="<?php echo $category[CategoryService::ID]; ?>" /></td>
					<td><?php echo $category[CategoryService::ID] ?></td>
					<td class="itemLast"><a class="linkLightTr" href="/edit-category.html?id=<?php echo $category[CategoryService::ID] ?>" title="<?php echo $category[CategoryService::CAT_NAME] ?>"><?php echo $category[CategoryService::CAT_NAME] ?></a></td>
				</tr>
				<?php } }else{ ?>
				<tr class="unitNoMail">
					<td colspan="5">_i18n{No Category}</td>
				</tr>
				<?php } ?>
			</tbody>
		</table>
		<div class="unitBtn"></div>
	</div>
	<h2>_i18n{SubCategory}</h2>
	<div class="unitABlock unitABlockLast">
		<table cellpadding="0" cellspacing="0" class="viewList">
			<thead>
				<tr>
					<th class="itemChk"><input type="hidden" name="itemSelectSubCategory" /></th>
					<th>_i18n{ID}</th>
					<th>_i18n{SubCategory}</th>
					<th class="itemLast">_i18n{Category}</th>
				</tr>
			</thead>
			<tbody>
	<?php 	if (count($subcategories)>0 && $subcategories!=NULL){
				foreach($subcategories as $key => $subcategory){ ?>
					<tr>
						<td><input type="checkbox" class="inpChk" name="SubCategory" value="<?php echo $subcategory[SubCategoryService::ID] ?>" /></td>
						<td><?php echo $subcategory[SubCategoryService::ID] ?></td>
						<td><a class="linkLightTr" href="/edit-subcategory.html?id=<?php echo $subcategory[SubCategoryService::ID] ?>" title="<?php echo $subcategory[SubCategoryService::SUBCAT_NAME] ?>"><?php echo $subcategory[SubCategoryService::SUBCAT_NAME] ?></a></td>
						<td class="itemLast"><?php echo $subcategory[CategoryService::CAT_NAME] ?></td>
					</tr>
	<?php } ?>
	<?php	}else {?>
				<tr class="unitNoMail">
					<td colspan="5">_i18n{No SubCategory}</td>
				</tr>
	<?php	} ?>
			</tbody>
		</table>
		<div class="unitBtn"></div>
	</div>
</form>